#!/bin/bash
#get this script real directory
SOURCE="$0"
while [ -h "$SOURCE"  ]; do # resolve $SOURCE until the file is no longer a symlink
    this_script_dir="$( cd -P "$( dirname "$SOURCE"  )" && pwd  )"
    SOURCE="$(readlink "$SOURCE")"
    # if $SOURCE was a relative symlink, 
    #we need to resolve it relative to the path 
    #where the symlink file was located
    [[ $SOURCE != /*  ]] && SOURCE="$this_script_dir/$SOURCE"
done
this_script_dir="$( cd -P "$( dirname "$SOURCE"  )" && pwd  )"


export p2pcpp_home=$this_script_dir/../..

bin_dir=$p2pcpp_home/bin
log_dir=$p2pcpp_home/log/$HOSTNAME
mkdir -p $log_dir


cd $bin_dir
log_file=$log_dir/nat_type_checker_`date +%Y-%m-%d`.log
./p2pcpp -t suite_checker/case_nat_type 2>&1 |tee $log_file  
